package javabasics.concurrent.futrue;

import java.util.concurrent.Callable;

/**
 * @Author suxiaoxiao
 * @Date 2019/6/16 0:12
 * @Version 1.0
 */
public class RealData implements Callable<String> {

    private String para;

    public RealData(String para) {
        this.para = para;
    }

    @Override
    public String call() throws Exception {
        // 这里是真实的业务逻辑，其执行可能很慢。
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; i < 10; i++) {
            stringBuffer.append(para);
            Thread.sleep(1000);
        }
        return stringBuffer.toString();
    }
}
